import React, { useState } from 'react'
import dynamic from 'next/dynamic'

const One = dynamic(import('../components/one'))

export default function Time() {
  const [nowTime, setNowTime] = useState(Date.now())
  const changeTime = async () => {
    const moment = await import('moment')
    setNowTime(moment.default(Date.now()).format())
  }

  return (
    <>
      <div>显示的时间为：{nowTime}</div>
      <One />
      <div>
        <button onClick={changeTime}>改变的时间格式</button>
      </div>
    </>
  )
}
